import React from "react";
import { createForm } from "rc-form";

const FormMiddleware = (params) => {
  return (Comp) => {
    console.log(Comp, 'Comp');
    let NewForm = createForm()(Comp);
    return (props) => {
      console.log(props, 'props');
      if (props.visible) {
        console.log(params, "params");
        console.log(Comp, "Comp");
        console.log(props, "props");

        return <NewForm {...props} />;
      } else {
        return <></>;
      }
    };
  };
};

export default FormMiddleware;